<!--
 * @页面名称:
 * @描述: 
 * @作者: 
 * @Date:
-->
<template>
  <div class="echarts" id="rightBottomChart"></div>
</template>

<script setup lang="ts">
import { reactive, ref } from "vue";
import { ECharts, EChartsOption, init } from "echarts";
import * as echarts from "echarts";

// 初始化图表
const initChart = (data: any): ECharts => {
  const charEle = document.getElementById("rightBottomChart") as HTMLElement;
  const charEch: ECharts = init(charEle);
  const option: EChartsOption = {
    tooltip: {
      trigger: "axis"
    },
    legend: {
      textStyle: {
        color: "#B4B4B4"
      }
    },
    xAxis: {
      type: "category",
      boundaryGap: false,
      data: ["普陀", "浦东", "奉贤", "金山", "闵行", "崇明", "嘉定"],
      axisLabel: {
        inside: false,
        color: "#fff"
      }
    },
    yAxis: {
      type: "value",
      axisLabel: {
        inside: false,
        color: "#fff"
      }
    },
    grid: {
      //布局
      show: true,
      left: "10px",
      right: "30px",
      bottom: "10px",
      top: "32px",
      containLabel: true,
      borderColor: "#1F63A3"
    },
    series: [
      {
        name: "本周新增",
        type: "line",
        data: [10, 11, 13, 11, 12, 12, 9]
      },
      {
        name: "本日新增",
        type: "line",
        data: [1, 4, 2, 5, 3, 2, 0]
      }
    ]
  };
  charEch.setOption(option);
  return charEch;
};
defineExpose({
  initChart
});
</script>

<style scoped lang="scss">
.echarts {
  width: 100%;
  height: 100%;
}
</style>
